using UnityEngine;
using System.Collections;

public class GunScript : MonoBehaviour {
	
	public Transform Bullet;
	public int ammunition;
 

	// Use this for initialization
	void Start () 
	{
		
		//OnFire (Vector2.right);
		ammunition = 2;
		
	}
	
	public void OnFire(Vector2 v_shot)
	{
		ammunition -= 1;
		
		Vector3 inFront =  (new Vector3(v_shot.x, 0, v_shot.y));           
		Transform tmp_bullet = PoolManager.Pools["Bullets"].Spawn(Bullet,inFront + transform.position, Quaternion.identity) as Transform;
		BulletScript tmp_bscript = tmp_bullet.GetComponent<BulletScript>();
		tmp_bscript.set_direction(v_shot);
		tmp_bscript.tag = "bullet";
	}
	

}
